/* *****************************************************************************
 * JFab (http://code.google.com/p/jfab)
 * Copyright (c) 2011 JFab.org
 * Admin jfab@jeffreythompson.net
 *
 * See the file "LICENSE.txt" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * *****************************************************************************/

package org.jfab.core.factory;

import org.jfab.core.collection.CGAnnotationList;
import org.jfab.core.collection.CGMethodDeclarationList;
import org.jfab.core.collection.CGParameterList;
import org.jfab.core.collection.CGPropertyList;
import org.jfab.core.collection.CGTypeList;
import org.jfab.core.collection.CommentList;
import org.jfab.core.collection.ModifierList;
import org.jfab.core.model.CGMethodDeclaration;
import org.jfab.core.model.CGType;

/**
 * Defines methods required by a code generator method declaration factory.
 */
public interface CGMethodDeclarationFactory
{
    /**
     * @param annotations Annotations.
     * @param modifiers Modifiers.
     * 
     * @return an addPropertyChangeListener() method.
     */
    CGMethodDeclaration createAddPropertyChangeListenerMethod(
            CGAnnotationList annotations, ModifierList modifiers);

    /**
     * @param annotations Annotations.
     * @param modifiers Modifiers.
     * 
     * @return an addPropertyChangeListener() method.
     */
    CGMethodDeclaration createAddPropertyChangeListenerNamedMethod(
            CGAnnotationList annotations, ModifierList modifiers);

    /**
     * @param referencedTypes Referenced types.
     * @param commentLines Comment lines.
     * @param annotations Annotations.
     * @param modifiers Modifiers (@see java.lang.reflect.Modifier)
     * @param returnType Return type.
     * @param methodName Method name. (required)
     * @param parameters Parameters.
     * @param throwsTypes Throws types.
     * 
     * @return a new code generator method.
     */
    CGMethodDeclaration createMethod(CGTypeList referencedTypes,
            CommentList commentLines, CGAnnotationList annotations,
            ModifierList modifiers, CGType returnType, String methodName,
            CGParameterList parameters, CGTypeList throwsTypes);

    /**
     * @param annotations Annotations.
     * @param modifiers Modifiers.
     * @param properties Properties.
     * 
     * @return a list of new property accessor methods.
     */
    CGMethodDeclarationList createPropertyAccessorMethods(
            CGAnnotationList annotations, ModifierList modifiers,
            CGPropertyList properties);

    /**
     * @param modifiers Modifiers.
     * @param properties Properties.
     * 
     * @return a list of new property mutator methods.
     */
    CGMethodDeclarationList createPropertyMutatorMethods(
            ModifierList modifiers, CGPropertyList properties);

    /**
     * @param annotations Annotations.
     * @param modifiers Modifiers.
     * @param properties Properties.
     * 
     * @return a new collection of mutator methods for the given properties.
     */
    CGMethodDeclarationList createPropertyMutatorPropertyChangeMethods(
            CGAnnotationList annotations, ModifierList modifiers,
            CGPropertyList properties);

    /**
     * @param annotations Annotations.
     * @param modifiers Modifiers.
     * 
     * @return a removePropertyChangeListener() method.
     */
    CGMethodDeclaration createRemovePropertyChangeListenerMethod(
            CGAnnotationList annotations, ModifierList modifiers);

    /**
     * @param annotations Annotations.
     * @param modifiers Modifiers.
     * 
     * @return a removePropertyChangeListener() method.
     */
    CGMethodDeclaration createRemovePropertyChangeListenerNamedMethod(
            CGAnnotationList annotations, ModifierList modifiers);
}
